package top.jolyoulu.modules.mybatisplusmodule.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.Resource;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;

import java.io.IOException;
import java.util.Arrays;
import java.util.List;

/**
 * @Author LuZhouJin
 * @Date 2023/10/13
 * 自定义设置 MybatisPlus参数
 */
@Slf4j
@Configuration
@ConfigurationProperties(value = "my-batis-plus-module-config")
public class MybatisPlusProperties {
    /**
     * xml路径
     */
    private String xmlPath;

    /**
     * 逻辑删除
     */
    private LogicDelete LogicDelete;

    public String getXmlPath() {
        return xmlPath;
    }

    public void setXmlPath(String xmlPath) {
        this.xmlPath = xmlPath;
    }

    public MybatisPlusProperties.LogicDelete getLogicDelete() {
        return LogicDelete;
    }

    public void setLogicDelete(MybatisPlusProperties.LogicDelete logicDelete) {
        LogicDelete = logicDelete;
    }

    public static class LogicDelete {
        /**
         * 逻辑删除属性名
         */
        private String logicDeleteField;
        /**
         * 未删除标记
         */
        private String logicNotDeleteValue;
        /**
         * 删除标记
         */
        private String logicDeleteValue;

        public String getLogicDeleteField() {
            return logicDeleteField;
        }

        public void setLogicDeleteField(String logicDeleteField) {
            this.logicDeleteField = logicDeleteField;
        }

        public String getLogicNotDeleteValue() {
            return logicNotDeleteValue;
        }

        public void setLogicNotDeleteValue(String logicNotDeleteValue) {
            this.logicNotDeleteValue = logicNotDeleteValue;
        }

        public String getLogicDeleteValue() {
            return logicDeleteValue;
        }

        public void setLogicDeleteValue(String logicDeleteValue) {
            this.logicDeleteValue = logicDeleteValue;
        }
    }
}
